<?php
require 'config.php';
$generate_time = microtime_float();
ob_clean();

$iType = getValue('iType','str','GET',0);
$iCat = getValue('iCat');

switch($iType) {
    case 1: 
        $type = 'news';
        if($iCat == 0) {
            $name = 'Tin tức';
            $rewrite = 'tin-tuc';
        }else {
            $db_cat = new db_query('SELECT * FROM categories_multi WHERE cat_id = '.$iCat);
            $cat = mysql_fetch_assoc($db_cat->result);unset($db_cat);
            $name = $cat['cat_name'];
            $rewrite = removeTitle($cat['cat_name']).'-'.$cat['cat_id'];
        }
        break;
    case 2: 
        $type = 'recruitment';
        $name = 'Tuyển dụng';
        $rewrite = 'tuyen-dung';
        break;
    case 3: 
        $type = 'promotion';
        $name = 'Khuyến mại';
        $rewrite = 'khuyen-mai';
        break;
    case 4: 
        $type = 'technology';
        $name = 'Góc kỹ thuật';
        $rewrite = 'goc-ky-thuat';
        break;
    default:
        $type = 'news';
        $name = 'Tin tức';
        $rewrite = 'tin-tuc';
        break;
}
$NewsController = new NewsController(null,$type);
?>
<?=$NewsController->loadHeader()?>
<body>
    <div class="top_header">
        <? include '../includes/inc_top_header.php'?>
    </div><!-- End top_header -->
    <div class="container">
        <div class="wrap_container">
            <? include '../includes/inc_header.php'?>
            <? include '../includes/inc_nav.php'?>
            <? include '../includes/inc_featured.php'?>
            <? include '../includes/inc_news_cat.php'?>
        </div><!-- End wrap_container -->
    </div><!-- End container -->
    <? include '../includes/inc_footer.php'?>
    <? include '../includes/inc_ads.php'?>
</body>
<?=$NewsController->loadFooter($generate_time)?>
